﻿/*  PandoraUnleashed
    An open source API for the Pandora music service
    Copyright © 2011 Saulius Milevicius

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PandoraUnleashed.Data
{
    class TrackData
    {
        public Boolean adImpressionRegistered { get; set; }
        public String album { get; set; }
        public String albumDetailUrl { get; set; }
        public String albumExplorerUrl { get; set; }
        public Boolean allowFeedback { get; set; }
        public String amazonAlbumAsin { get; set; }
        public String amazonAlbumUrl { get; set; }
        public String amazonAlbumDigitalAsin { get; set; }
        public String amazonSongDigitalAsin { get; set; }
        public String artUrl { get; set; }
        public String artistDetailUrl { get; set; }
        public String artistExplorerUrl { get; set; }
        public Dictionary<String, Dictionary<String, String>> audioUrlMap { get; set; }
        public String creator { get; set; }
        public int duration { get; set; }
        public String itunesSongUrl { get; set; }
        public int lastHeardPosition { get; set; }
        public long lastHeardTime { get; set; }
        public String nowPlayingStationAdUrl { get; set; }
        public String songDetailUrl { get; set; }
        public String songExplorerUrl { get; set; }
        public int songRating { get; set; }
        public long station_id { get; set; }
        public String title { get; set; }
        public String trackGain { get; set; }
        public String trackToken { get; set; }

        /// <summary>
        /// Default constructor for track data
        /// </summary>
        /// <param name="stationId">The stations id</param>
        public TrackData(long stationId)
        {
            if (stationId <= 0)
                throw new Exception("Invalid station id");
            this.station_id = stationId;
            this.lastHeardTime =(long)(DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds;
        }

        /// <summary>
        /// Default track data constructor
        /// </summary>
        /// <param name="stationId">Stations id</param>
        /// <param name="title">Title of track</param>
        /// <param name="creator">Artist/Creator</param>
        /// <param name="album">Album name</param>
        /// <param name="artUrl">Album art url</param>
        /// <param name="trackToken">Track token</param>
        /// <param name="nowPlayingStationAdUrl">Station ad url</param>
        /// <param name="allowFeedback">Feedback is allowed</param>
        /// <param name="songRating">Song rating</param>
        /// <param name="trackGain">Track gain</param>
        /// <param name="audioUrlMap">Audio url map</param>
        /// <param name="amazonSongDigitalAsin">Amazon song digital identification number</param>
        /// <param name="artistExplorerUrl">Artist info url</param>
        /// <param name="itunesSongUrl">iTunes song url</param>
        /// <param name="amazonAlbumUrl">Amazon album url</param>
        /// <param name="amazonAlbumDigitalAsin">Amazon album digital identification number</param>
        /// <param name="artistDetailUrl">Artist details url</param>
        /// <param name="albumDetailUrl">Album details url</param>
        /// <param name="songDetailUrl">Song details url</param>
        /// <param name="amazonAlbumAsin">Amazon album identification number</param>
        /// <param name="albumExplorerUrl">Album info url</param>
        /// <param name="songExplorerUrl">Song info url</param>
        public TrackData(long stationId, String title, String creator, String album, String artUrl, String trackToken, String nowPlayingStationAdUrl, Boolean allowFeedback, int songRating, String trackGain, Dictionary<String, Dictionary<String, String>> audioUrlMap, String amazonSongDigitalAsin, String artistExplorerUrl, String itunesSongUrl, String amazonAlbumUrl, String amazonAlbumDigitalAsin, String artistDetailUrl, String albumDetailUrl, String songDetailUrl, String amazonAlbumAsin, String albumExplorerUrl, String songExplorerUrl)
        {
            this.station_id = stationId;
            this.title = title;
            this.creator = creator;
            this.album = album;
            this.artUrl = artUrl;
            this.trackToken = trackToken;
            this.nowPlayingStationAdUrl = nowPlayingStationAdUrl;
            this.allowFeedback = allowFeedback;
            this.songRating = songRating;
            this.duration = 0;
            this.trackGain = trackGain;
            this.audioUrlMap = audioUrlMap;
            this.adImpressionRegistered = adImpressionRegistered;
            this.amazonSongDigitalAsin = amazonSongDigitalAsin;
            this.artistExplorerUrl = artistExplorerUrl;
            this.lastHeardPosition = 0;
            this.itunesSongUrl = itunesSongUrl;
            this.amazonAlbumUrl = amazonAlbumUrl;
            this.amazonAlbumDigitalAsin = amazonAlbumDigitalAsin;
            this.artistDetailUrl = artistDetailUrl;
            this.albumDetailUrl = albumDetailUrl;
            this.songDetailUrl = songDetailUrl;
            this.amazonAlbumAsin = amazonAlbumAsin;
            this.albumExplorerUrl = albumExplorerUrl;
            this.songExplorerUrl = songExplorerUrl;
            this.lastHeardTime = (long)(DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds;
        }
    }
}
